<?php
$this->breadcrumbs = array(
    'Menus' => array('index'),
    'Manage',
);

$this->menu = array(
    array('label' => 'List Menu', 'url' => array('index')),
    array('label' => 'Create Menu', 'url' => array('create')),
);

?>

<h1>Manage Menus</h1>

<?php
$this->widget('bootstrap.widgets.TbGridView', array(
    'id' => 'menu-grid',
    'dataProvider' => $model->search(),
//    'filter' => $model,
    'columns' => array(
        'id',
        'name',
        array(
            'name' => 'parent_id',
            'header' => 'Menu cha',
            'type'=>'html',
            'value' => '$data->parent_id==0?"<b style=\"color:red\">None</b>":"<b style=\"color:green\">".$data->parent->name."</b>"'
        ),
        array(
            'name' => 'status',
            'header' => 'Trạng thái',
            'class' => 'bootstrap.widgets.TbEditableColumn',
            'headerHtmlOptions' => array('style' => 'width:80px'),
            'editable' => array(
                'type' => 'select',
                'url' => $this->createUrl('menu/updatemenu'),
                'placement' => 'right',
                'inputclass' => 'span2',
                'source' => array(0 => 'Ẩn', 1 => 'Hiện'),
            )
        ),
        /*
          'keyword',
          'title',
          'status',
          'stt',
         */
        array(
            'class' => 'bootstrap.widgets.TbButtonColumn',
            'template' => '{view} {update}'
        ),
    ),
));
?>
